﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DropDownList2.Items.Add("福建");
                DropDownList2.Items.Add("江西");
                DropDownList2.Items.Add("广西");
            }
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string province = DropDownList2.SelectedValue;
            DropDownList3.Items.Clear();
            if (province=="福建")
            {
                DropDownList3.Items.Add("龙岩");
                DropDownList3.Items.Add("厦门");
                DropDownList3.Items.Add("连城");
            }
            else if (province=="江西")
            {
                DropDownList3.Items.Add("赣州");
                DropDownList3.Items.Add("南昌");
                DropDownList3.Items.Add("景德镇");
            }
            else
            {
                DropDownList3.Items.Add("南宁");
                DropDownList3.Items.Add("桂林");
                DropDownList3.Items.Add("崇左");
            }
            Literal1.Text = $"用户名：{TextBox1.Text}，性别:{DropDownList1.SelectedValue}，爱好：{CheckBoxList1.SelectedValue},籍贯：{DropDownList2.SelectedValue}省，{DropDownList3.SelectedValue}市，其它信息:{TextBox3.Text}";
        }

    }

}